﻿<UserControl x:Class="VmroleAuthor.Views.DeployView"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:vw="clr-namespace:VmroleAuthor.Views"  
             xmlns:vm="clr-namespace:VmroleAuthor.ViewModels" 
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"           
             mc:Ignorable="d" 
             d:DesignWidth="600"
             d:DesignHeight="540"
             >

    <UserControl.Resources>
        <DataTemplate DataType="{x:Type vm:DeployLandingPageViewModel}">
            <vw:DeployLandingPageView/>
        </DataTemplate>

        <DataTemplate DataType="{x:Type vm:DeploySettingsPageViewModel}">
            <vw:DeploySettingsPageView/>
        </DataTemplate>

        <DataTemplate DataType="{x:Type vm:DeployResultsPageViewModel}">
            <vw:DeployResultsPageView/>
        </DataTemplate>
    </UserControl.Resources>
    
    <Grid >
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="6" />
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="6" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="6" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="6" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <!-- Page Title and Separator -->
        <Grid Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="12" />
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="12" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="6" />
                <RowDefinition Height="6" />
            </Grid.RowDefinitions>
            <TextBlock Grid.Row="0" Grid.Column="1" FontSize="14" VerticalAlignment="Center" 
                FontWeight="SemiBold"
                Text="{Binding Path=PageTitle}"/>
            <Separator Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="3" Foreground="{x:Static SystemColors.HotTrackBrush}"
                VerticalAlignment="Center" />
            <Button Padding="0"  BorderBrush="Transparent" BorderThickness="0" Grid.Row="0" Grid.Column="2" 
                        Background="Transparent"  Command="{Binding SettingsCommand}" Visibility="{Binding Path=AltButtonVisibility}"
                     ToolTip="View Settings">
                <StackPanel Orientation = "Horizontal" HorizontalAlignment="Right">
                    <Image HorizontalAlignment="Left" Height="20" Width="20" Source="../Img/scriptapplication.ico" />
                </StackPanel>
            </Button>
            <Button Padding="0"  BorderBrush="Transparent" BorderThickness="0" Grid.Row="0" Grid.Column="3" 
                        Background="Transparent"  Command="{Binding PowerShellScriptCommand}" Visibility="{Binding Path=AltButtonVisibility}"
                     ToolTip="View PowerShell Script">
                <StackPanel Orientation = "Horizontal" HorizontalAlignment="Right">
                    <Image HorizontalAlignment="Left" Height="24" Width="24" Source="../Img/PowerShell_32.png" />
                </StackPanel>
            </Button>
        </Grid>

        <!-- Current page (Landing, Settings, Results) -->
        <ContentControl Grid.Row="2" Grid.Column="1"
                Content="{Binding Path=CurrentDeployPage}"/>

        <!-- Icon with ResExt details block -->
        <Grid Grid.Row="2" Grid.Column="2">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="30"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="6"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="36" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="6" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="6" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="6" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="6" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="6" />
            </Grid.RowDefinitions>

            <!-- ResExt Details and Icon -->
            <Image Grid.Row="1" Grid.Column="1" HorizontalAlignment="Left"   Height="60" Width="60" Source="../Img/generic_60.png" />
            <TextBlock FontSize="16" Grid.Row="1" Grid.Column="3" VerticalAlignment="Center" Foreground="{x:Static SystemColors.ControlDarkBrush}" MinWidth="120" 
                 Text="{Binding Path=ResExtName, Mode=OneWay}"/>
            <TextBlock FontSize="10" Grid.Row="3" Grid.Column="1" VerticalAlignment="Center" Foreground="{x:Static SystemColors.ControlDarkBrush}" 
                 Text="VERSION"/>
            <TextBlock FontSize="10" Grid.Row="3" Grid.Column="3" VerticalAlignment="Center" Foreground="{x:Static SystemColors.ControlDarkBrush}" 
                 Text="{Binding Path=ResExtVersion, Mode=OneWay}"/>
            <TextBlock FontSize="10" Grid.Row="5" Grid.Column="1" VerticalAlignment="Center" Foreground="{x:Static SystemColors.ControlDarkBrush}" 
                Text="PUBLISHER"/>
            <TextBlock FontSize="10" Grid.Row="5" Grid.Column="3" VerticalAlignment="Center" Foreground="{x:Static SystemColors.ControlDarkBrush}" 
                Text="{Binding Path=ResExtPublisher, Mode=OneWay}"/>
            <TextBlock FontSize="10" Grid.Row="7" Grid.Column="1" VerticalAlignment="Center" Foreground="{x:Static SystemColors.ControlDarkBrush}" 
                Text="SERVICE" Visibility="{Binding Path=ConfigVisibility}"/>
            <TextBlock FontSize="10" Grid.Row="7" Grid.Column="3" VerticalAlignment="Center" Foreground="{x:Static SystemColors.ControlDarkBrush}" 
                Text="{Binding Path=ResExtService, Mode=OneWay}" Visibility="{Binding Path=ConfigVisibility}"/>
            <TextBlock FontSize="10" Grid.Row="9" Grid.Column="1" VerticalAlignment="Center" Foreground="{x:Static SystemColors.ControlDarkBrush}" 
                Text="VM" Visibility="{Binding Path=ConfigVisibility}"/>
            <TextBlock FontSize="10" Grid.Row="9" Grid.Column="3" VerticalAlignment="Center" Foreground="{x:Static SystemColors.ControlDarkBrush}" 
                Text="{Binding Path=ResExtVM, Mode=OneWay}" Visibility="{Binding Path=ConfigVisibility}"/>

        </Grid>

        <!-- Back or Next wizard buttons -->
        <StackPanel Orientation = "Horizontal" HorizontalAlignment="Right" Grid.Row="4" Grid.Column="2" >
            <Grid>
                <Grid.RowDefinitions >
                    <RowDefinition Height="6" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="6" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="10"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="10"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="6"/>
                </Grid.ColumnDefinitions>
                <Button Padding="0"  BorderBrush="Transparent" BorderThickness="0" Grid.Row="1" Grid.Column="1" ToolTip="Back button"
                        Background="Transparent"  Command="{Binding BackPageCommand}" Visibility="{Binding Path=BackButtonVisibility}" >
                    <StackPanel Orientation = "Horizontal" HorizontalAlignment="Right">
                        <Image HorizontalAlignment="Left" Height="34" Width="34" Source="../Img/previous_34.png" />
                    </StackPanel>
                </Button>
                <Button Padding="0" BorderBrush="Transparent" BorderThickness="0" Grid.Row="1" Grid.Column="3" ToolTip="{Binding NextButtonToolTip}"
                        Background="Transparent" Command="{Binding NextPageCommand}" Visibility="{Binding Path=NextButtonVisibility}">
                    <StackPanel Orientation = "Horizontal" HorizontalAlignment="Right">
                        <Image HorizontalAlignment="Left" Height="34" Width="34" Source="{Binding Path=NextButtonSource}" />
                    </StackPanel>
                </Button>            
            </Grid>
        </StackPanel>     
    </Grid>
</UserControl>
